package com.dai.design.openclose;


/**
 * @author daijiyong
 */
public class OpenCloseTest {
    public static void main(String[] args) {

        // 一个鸡腿商品
        ICommodity commodity = new FoodCommodity(1, "鸡腿", 30D);

        System.out.println(commodity);

        // 打折鸡腿商品
        commodity = new DiscountFoodCommodity(1, "鸡腿", 30D, 0.5D);

        System.out.println(commodity);

        //拿到打折商品的原价
        System.out.println(commodity.getPrice());

    }
}
